1. Field of the Invention
The present invention relates to an image processing apparatus and method, and more particularly, to an image processing apparatus and a method which performs tone correction on inputted images.
2. Description of the Related Art
Conventional techniques for performing tone correction of images involve making shadow corrections to correct luminance of dark portions contained in the images, making contrast corrections to increase contrast of the images, and so on. For example, a large number of dark portions are contained in an image which has a luminance histogram such as shown in FIG. 10A, and if the luminance of the dark portions is increased using a correction curve such as shown in FIG. 10B, an image of more appropriate brightness can be obtained. In many photography scenes, such tone correction allows photographed images to be corrected into more desirable images.
However, when such a correction is applied to a scene whose image contains large high-chroma regions, the balance among color components of pixels in the high-chroma regions can be lost, resulting in color deviation. Suppose, for example, FIG. 10A is a luminance histogram of a scene in which a vivid red flower is shown in the center of an image and an 8-bit RGB value in part of the flower is RGB=(255, 56, 94). The luminance obtained from a conversion formula defined by sRGB and given by Eq. (1) below is Y=approximately 120.Y=0.299R+0.587G+0.114B  (1)
The calculated luminance of 120 is plotted at a point indicated by x in the luminance histogram of FIG. 10A, and it can be seen that the luminance is not very high. The luminance undergoes a substantial correction as can be seen from the amount of correction for x in FIG. 10B. However, in order to apply shadow correction to such a region while maintaining RGB color balance, R needs to exceed 255. However, if one attempts to express the R, G, and B values in 8 bits, an R component is cropped at 255. As a result, only G and B components are raised with R remaining the same as before. Consequently, the RGB color balance changes from the original ratio, causing color deviation.
To deal with this problem, a technique disclosed in Japanese Patent Laid-Open No. 2007-243542 performs chroma correction by calculating chroma in a central portion of an image and determining an amount of correction based on a proportion of high-chroma pixels in the region and the like.
Also, a technique disclosed in Japanese Patent Laid-Open No. 2002-335536 calculates amounts of correction on a pixel by pixel basis at the luminance of the respective pixels, and then calculates actual amounts of correction by reducing the calculated amounts of correction differently according to the chroma of the pixels, where the higher the chroma, the greater the reduction.
However, when a technique, such as the technique disclosed in Japanese Patent Laid-Open No. 2007-243542, which is based solely on the proportion in which high-chroma pixels are contained in a given region, is applied to tone corrections, the amount of correction could be suppressed with respect to scenes to which tone correction can normally be applied safely. For example, in shadow correction, the amounts of correction are generally reduced with respect to regions whose luminance is too low or regions whose luminance is too high as shown in FIG. 10B, in order to give a more natural look. Even when tone correction such as shown in FIG. 10B is applied to a scene which contains a large number of high-chroma regions, if the regions have high luminance or low luminance, color deviation is less likely to occur. The correction such as shown in FIG. 10B may result in a good image corrected to an appropriate brightness as a whole. However, if tone correction is weakened simply for the reason that the scene contains a large number of high-chroma regions, tone corrections which are safe to make will also be suppressed.
On the other hand, a technique, such as the technique disclosed in Japanese Patent Laid-Open No. 2002-335536, which checks chroma and determines the amounts of correction on a pixel by pixel basis, needs to calculate information for determination of high chroma, including a hue and chroma, on a pixel by pixel basis, and then calculate an appropriate amount of correction at the chroma level of each pixel. Consequently, calculation time increases with increases in pixel count. Furthermore, if tone correction is applied on a pixel by pixel basis to a scene such as a flower whose chroma is not uniform and varies with the shade, although the amounts of correction of the regions whose chroma is saturated are suppressed, the surrounding regions whose chroma is not saturated are subjected to correction. Although this enables making corrections without causing chromatic saturation, chromatic details of the original image could be lost. As an example, FIG. 10C shows variations in the chroma of a linear region in a scene showing a vivid red flower. When corrections are made to the scene on a pixel by pixel basis, the variations in chroma become as shown in FIG. 10D. When FIG. 10C and FIG. 10D are compared, fine variations in chroma have been lost in FIG. 10D after the corrections. In particular, when chromatic details are reduced in high-chroma regions, one could feel as though there were color deviations even though actually there is no color deviation.